﻿Public Class frmVisor

    Private Sub btnGenerar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGenerar.Click
        Dim ds As New DataSet1
        'Dim dt As New DataTable("Folios")
        Dim folios As cFolios
        Dim arreglo As Integer()
        Dim dc1 As New DataColumn("Num")
        Dim reporteJ As New rptContabHojasSueltasHJomex
        Dim reporteR As New rptContabHojasSueltasH

        'ds.Tables.Add(dt)
        'dt.Columns.Add(dc1)
        folios = New cFolios(CInt(txtIni.Text), CInt(txtCant.Text))
        arreglo = folios.folios
        For i As Integer = 0 To arreglo.Length - 1
            Dim dr As DataRow = ds.Tables(0).NewRow
            dr("Num") = arreglo(i)
            ds.Tables(0).Rows.Add(dr("Num"))
        Next
        'If radioH.Checked = True Then
        '    reporteH.SetDataSource(ds.Tables(0))
        '    crv1.ReportSource = reporteH
        'Else
        '    reporteV.SetDataSource(ds.Tables(0))
        '    crv1.ReportSource = reporteV
        'End If
        If cbSociedad.Text = "Jomex" Then
            reporteJ.SetDataSource(ds.Tables(0))
            crv1.ReportSource = reporteJ
        Else
            reporteR.SetDataSource(ds.Tables(0))
            crv1.ReportSource = reporteR
        End If
    End Sub

End Class